<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <meta name="description"        content="biển xanh côn đảo"/>
        <meta name="keywords"            content=""/>
        <meta name="author"                content="RoamCat"/>
        <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
        <meta name="viewport"           content="width=device-width" />

        <title><?php echo CHtml::encode($this->pageTitle); ?></title>

        <!-- My CSS -->
        <link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo Yii::app()->request->baseUrl; ?>/css/home/960_layout.css"/>
        <link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo Yii::app()->request->baseUrl; ?>/css/common/FontAwesome/font-awesome.css"/>

        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/css/common/css_form/css3_element.css"/>
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/css/common/themes/flick/jquery.ui.all.css"/>
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/css/common/slide_show/nivo_slider/default.css"/>
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/css/common/slide_show/nivo_slider/nivo-slider.css"/>
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/css/common/css_menu/menu_horizon.css"/>
        <!-- End My CSS -->

        <!-- My Javascript -->
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/javaScript/jquery-1.8.2.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/javaScript/jquery-ui-1.9.0.custom.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/javaScript/OS_function.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/javaScript/html_encoder.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/javaScript/slide_show/jquery.nivo.slider.js"></script>
        <!-- End My JavaScript -->    

        <script type="text/javascript">
        $(window).load(function() {
            $('#nivo_slider').nivoSlider({
                pauseTime: 5000,
                pauseOnHover: true
            });

            //Set main sector = screen height
            var i_divBodyContent = $('.body_content').outerHeight(),
                i_mainHeight = $(window).height() - $('.header').outerHeight() - $('.nav_primary').outerHeight() - $('.footer').outerHeight() - 16 ;
            if( i_divBodyContent < i_mainHeight)
            {
                $('.body_content') .css({'height': ((i_mainHeight))+'px'});
            }
        });//End $(window).load

        function submitSearchForm(eForm)
        {
            var sSearch = eForm.txt_tim.value;
            sSearch = remove_utf8(sSearch.toLowerCase());

            var special_character = " ,@!/-#%&";//unavailable:$^*()
            for(var i = 0; i < special_character.length;i++){
                sSearch = sSearch.replace(new RegExp(special_character.charAt(i), 'g'),"-");
            }

            //eForm.txt_tim.value = sSearch;
            return true;
        }
        </script>
    </head>

<body>

<div class="header">
<div class="container_960">
    <div class="grid_232">
        <a title="" href="">
            <img 
                alt="logo"
                src=""
                class="logo_left"
                align="top"
            />
        </a>
    </div><!-- end grid_232 -->

    <div class="grid_712 margin_top_4">
        <div class="right_text">
            <p class="margin_bottom_4">
                <lable><?=Yii::app()->user->name;?></lable>
            </p>

            <a href="<?=Yii::app()->createAbsoluteUrl( "cart/index");?>">
            <span class="icon-basket">
            	<i class="fa fa-shopping-cart"></i>
                <label id="lbl_TotalProductCart"><?=count(Yii::app()->session["cart"]);?></label>
            </span>
            </a>
        </div>

        <div class="clear"></div>
        <form 
            action   = "<?=Yii::app()->createAbsoluteUrl( "product/search");?>"
            method   = "get"
            onsubmit = "return submitSearchForm(this);"
            class    = "search_form right_text"
        >
            <p>
                <input 
                    type    = "hidden"
                    name    = "page"
                    id      = "page"
                    value   = "1"
                />

                <input 
                    type    = "text"
                    name    = "txt_tim"
                    id      = "txt_tim"
                    class   = "text_search"
                    value   = "Nhập Từ Khoá Tìm Kiếm"
                    onclick = "this.value='';"
                    onblur  = "if(this.value=='') this.value='Nhập Từ Khoá Tìm Kiếm';"
                />

                <span class="button_search"><i class="fa fa-search"></i></span>
            </p>
        </form>
    </div><!-- end grid_712 -->
</div><!-- end grid_712 -->
</div><!-- End class header -->

<div class="clear"></div>

<div class="nav_primary">
    <div class="container_960">
        <div class="grid_952">
            <div class="horizon_navigation">
                <ul id="nav_h" class="dropdown">
                    <li class="symbol" ><a href="<?=Yii::app()->baseUrl;?>"><i class="fa fa-home fa-2x"></i></a></li>
                    <li class="separated_line"></li>
                    <li> <a href="<?=Yii::app()->createAbsoluteUrl("product/index");?>">Sản Phẩm</a> </li>
                    <li class="separated_line"></li>
                    <li><a href="<?=Yii::app()->createAbsoluteUrl("article/index",array( 'categoryUrl'=>'about', 'articleId'=>1, 'articleUrl'=>'gioi-thieu'));?>">Giới Thiệu</a></li>
                    <li class="separated_line"></li>
                    <li> <a href="/">Liên Hệ</a> </li>
                </ul>

                <?php if(!Yii::app()->user->isGuest) {?>
                <ul class = "user_navigation" >
                    <li class="li_pannel">
                        <a href="javaScript:void(0);"><?=Yii::app()->user->name;?></a>

                        <ul>
                            <li class="update_account"    ><a href="<?=Yii::app()->createUrl("account/modify");?>">Sửa thông tin cá nhân</a></li>
                            <li class="change_password"    ><a href="<?=Yii::app()->createUrl("account/password");?>">Đổi mật khẩu</a></li>
                            <?php if( Yii::app()->user->authority == Account::ADMIN ) {?>
                            <li class="manage_website"    ><a href="<?=Yii::app()->createUrl("admin.php/site") ?>">Quản Lý Website</a></li> 
                            <?php } ?>
                            <li class="logout" id="btn_logout"><a href="<?=Yii::app()->createUrl("site/logout");?>">Thoát</a></li>
                        </ul>
                    </li>
                </ul><!-- end class user_navigation -->
                <?php }?>
            </div><!-- End class horizon_navigation -->
        </div><!-- End class grid_952 -->
    </div><!-- End class container_960 -->
</div><!-- End class nav_primary -->

<div class="clear"></div>

<div class="body_content">
<div class="container_960">
    <?php echo $content; ?>
</div><!-- end class container_960 -->
</div><!-- end class body_content -->

<div class="clear"></div>

<footer class="footer">
<?php $this->widget('SiteFooterWidget');?>
</footer>

</body>
</html>